﻿<cfsilent>
	<cfscript>
		
		event.setArg("pageTitle", "外语等级考试 - 通过率报告");
		
		currentTab = event.getArg("TabID", "labSummary");
		
		/* 学院四六级成绩分布情况 */
		sql = "SELECT 
				institute_id, institute_short, 
				exam_id, 
				scroll_avg, scroll_high, scroll_low, 
				student_taken, student_passed, student_good 
				FROM mv_institute_cet_status 
				ORDER BY institute_short ";
		
		queryObj = new Query( datasource=application.dnsSlave );

		rs_cet = queryObj.execute( sql=sql ).getResult();
		
		instituteArray = [];
		
		statStruct = {};
		
		for ( a=1; a LTE rs_cet.recordCount; a++ ) {
			
			if ( not arrayFind( instituteArray, [ rs_cet["institute_id"][a], rs_cet["institute_short"][a] ] ) ) {
				arrayAppend( instituteArray, [ rs_cet["institute_id"][a], rs_cet["institute_short"][a] ] );
			}
			
			structInsert( statStruct, rs_cet["exam_id"][a] & "-" & rs_cet["institute_id"][a] & "-HL", [ rs_cet["scroll_low"][a], rs_cet["scroll_high"][a] ], true );
			
			structInsert( statStruct, rs_cet["exam_id"][a] & "-" & rs_cet["institute_id"][a] & "-TP", [ rs_cet["student_passed"][a], rs_cet["student_taken"][a] ], true );
			
			structInsert( statStruct, rs_cet["exam_id"][a] & "-" & rs_cet["institute_id"][a] & "-AVG", rs_cet["scroll_avg"][a], true );
			
		}
		
	</cfscript>
</cfsilent>

<div id="headArea">
	<div class="uiHeader uiHeaderWithImage ptm">
		<div class="clearfix uiHeaderTop">
			<div class="uiHeaderActions rfloat">
				<a class="uiButton" href="<cfoutput>#buildURL('cetState')#</cfoutput>"><i class="mrs img btnPublish"></i><span class="uiButtonText">学生报名情况</span></a>
			</div>
			<div>
				<h2 class="uiHeaderTitle">
					<i class="uiHeaderImage img icon16x16 bar"></i>过级率分析报告
				</h2>
			</div>
		</div>
	</div>
</div>

<div class="UIElement">
	<ul class="senateFirstPage">
		<li>
			<div class="clearfix" id="create">
				<div class="UItab">
					<div class="tabLables">
						<span <cfif currentTab eq "labSummary">class="active"</cfif> id="labSummary" tabTarget="Summary">全校过级率</span>
						<span <cfif currentTab eq "labCET4">class="active"</cfif> id="labCET4" tabTarget="CET4">四级专业年级过级率</span>
						<span <cfif currentTab eq "labCET6">class="active"</cfif> id="labCET6" tabTarget="CET6">六级专业年级过级率</span>
					</div>
				</div>
				<script language="javascript" type="text/javascript">
					//<![CDATA[
					<!--
					$(document).ready(function() {
						
						/* init Tab */
						$("div.tabContent").hide();
						$("div#" + $("div.tabLables span.active").attr("tabTarget")).show();
						
						$("div.tabLables > span").click(function(){
							var $targetID = $(this).attr("tabTarget");
							
							$("div.tabLables span").removeClass("active");
							$(this).addClass("active");
							
							$("div.tabContent").not('[id="' + $targetID + '"]').hide();
							$("div.tabContent#" + $targetID).show();
						});
						
					});
					
					// -->
					//]]>
				</script>
				
				<div id="Summary" class="tabContent">
					
					<div class="noticeBlock">
						<h3>全国大学外语等级考试过级率分析报告</h3>
						<p>
							<span class="img icon16x16 message"></span>
							截至目前, 全校各教学单位外语等级考试的累计通过率. 
							在计算通过率时, 一名学生有多次考试成绩仅计算最高值且仅计数一次. 
							分子为 <em>CET</em> 考试成绩超过 <em>425</em> 分的学号唯一计数, 分母为参加四六级考试的学号唯一计数, 缺考学生不计.
						</p>
						<hr/>
					</div>
					
					<div class="mtl mbl">
						<table class="UItable">
							<tr class="cellBorder cellCenter">
								<td>学院</td>
								<cfloop array="#instituteArray#" index="institute">
									<td><cfoutput>#institute[2]#</cfoutput></td>
								</cfloop>
							</tr>
							<tr class="cellBorder cellCenter">
								<td><span class="number">CET4</span></td>
								<cfloop array="#instituteArray#" index="institute">
									<td>
										<cfif structKeyExists( statStruct, "CET4-" & institute[1] & "-TP" )>
											<cfset percent =  numberFormat( 100 * ( statStruct["CET4-" & institute[1] & "-TP"][1] / statStruct["CET4-" & institute[1] & "-TP"][2] ), "__._" ) />
											<span class="number"><cfoutput>#percent#</cfoutput></span>
										</cfif>
									</td>
								</cfloop>
							</tr>
							<tr class="cellBorder cellCenter">
								<td><span class="number">CET6</span></td>
								<cfloop array="#instituteArray#" index="institute">
									<td>
										<cfif structKeyExists( statStruct, "CET6-" & institute[1] & "-TP" )>
											<cfset percent =  numberFormat( 100 * ( statStruct["CET6-" & institute[1] & "-TP"][1] / statStruct["CET6-" & institute[1] & "-TP"][2] ), "__._" ) />
											<span class="number"><cfoutput>#percent#</cfoutput></span>
										</cfif>
									</td>
								</cfloop>
							</tr>
						</table>
					</div>
					
					<div class="mtl mbl"></div>
					
					<div class="noticeBlock">
						<h3>各学院四六级成绩分布图</h3>
						<hr/>
					</div>
					
					<div id="container" style="height:350px;"></div>
					
					<script language="javascript" type="text/javascript">
						//<![CDATA[
						<!--

						$(document).ready(function() {
							
							$('#container').highcharts({
								chart: {
									type: 'columnrange'
									},
								colors: ['#4572A7','#AA4643','#89A54E','#80699B'],
								title: {
									text: null
									},
								subtitle: {
									text: null
									},
								xAxis: {
									categories: [<cfset i = 0 /><cfloop array="#instituteArray#" index="institute"><cfset i++ />'<cfoutput>#institute[2]#</cfoutput>'<cfif i lt arrayLen(instituteArray)>,</cfif></cfloop>], 
									labels: {
										style: {
											fontSize: '12px'
											}
										}
									},
								yAxis: {
									title: {
										text: null
										}
									},
								tooltip: {
									
									},
								credits: {
									enabled: false
									},
								legend: {
									enabled: true
									},
								series: [{
									name: '四级',
									data: [
											<cfset i = 0 /><cfloop array="#instituteArray#" index="institute"><cfset i++ /><cfif structKeyExists( statStruct, "CET4-" & institute[1] & "-HL" )>[<cfoutput>#statStruct["CET4-" & institute[1] & "-HL"][1]#</cfoutput>,<cfoutput>#statStruct["CET4-" & institute[1] & "-HL"][2]#</cfoutput>]<cfelse>null</cfif><cfif i lt arrayLen(instituteArray)>,</cfif></cfloop>
											]
										},{
									name: '六级',
									data: [
											<cfset i = 0 /><cfloop array="#instituteArray#" index="institute"><cfset i++ /><cfif structKeyExists( statStruct, "CET6-" & institute[1] & "-HL" )>[<cfoutput>#statStruct["CET6-" & institute[1] & "-HL"][1]#</cfoutput>,<cfoutput>#statStruct["CET6-" & institute[1] & "-HL"][2]#</cfoutput>]<cfelse>null</cfif><cfif i lt arrayLen(instituteArray)>,</cfif></cfloop>
											]
										},{
									type: 'spline',
									name: '四级平均分',
									data: [
											<cfset i = 0 /><cfloop array="#instituteArray#" index="institute"><cfset i++ /><cfif structKeyExists( statStruct, "CET4-" & institute[1] & "-AVG" )><cfoutput>#statStruct["CET4-" & institute[1] & "-AVG"]#</cfoutput><cfelse>null</cfif><cfif i lt arrayLen(instituteArray)>,</cfif></cfloop>
											]
										},{
									type: 'spline',
									name: '六级平均分',
									data: [
											<cfset i = 0 /><cfloop array="#instituteArray#" index="institute"><cfset i++ /><cfif structKeyExists( statStruct, "CET6-" & institute[1] & "-AVG" )><cfoutput>#statStruct["CET6-" & institute[1] & "-AVG"]#</cfoutput><cfelse>null</cfif><cfif i lt arrayLen(instituteArray)>,</cfif></cfloop>
											]
										}]
							});
							
						});
					
						// -->
						//]]>
					</script>
					
					
					
				</div>
				
				<div id="CET4" class="tabContent">
					<div class="noticeBlock">
						<h3>各专业年级四级过级率分析报告</h3>
						<hr/>
					</div>
					
					<!--- 显示四级过级率统计--->
					<!-- tableCET4 -->
					<cfoutput>#event.getArg("tableCET4")#</cfoutput>
					<!-- /tableCET4 -->
					
					
				</div>
				
				<div id="CET6" class="tabContent">
					<div class="noticeBlock">
						<h3>各专业年级六级过级率分析报告</h3>
						<hr/>
					</div>
					
					<!--- 显示六级过级率统计--->
					<!-- tableCET4 -->
					<cfoutput>#event.getArg("tableCET6")#</cfoutput>
					<!-- /tableCET4 -->
					
				</div>
				
			</div>
		</li>
	</ul>
</div>